home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-21 / xcb-20.zip / XCB.MAN < prev   
Text File  |  1992-11-11  |  8KB  |  253 lines

  1. XCB 1 "May 6 1992" "X Version 11"
  2.  NAME
  3. xcb - X Cut Buffers - Pigeon holes for your cut and paste selections.
  4.  SYNOPSIS
  5. xcb
  6. [Xt option]
  7. [-l layout]
  8. [-n count]
  9. [-p|-s list]
  10. [-r count]
  11.  DESCRIPTION
  12. Xcb provides easy access to the cut buffers built into every X server.
  13. It allows the buffers to be manipulated either via the command line,
  14. or with the mouse in a point and click manner.
  15. The buffers can be used as holding pens to store and retrieve
  16. arbitrary data fragments.
  17. Any number of cut buffers may be created,
  18. so any number of different pieces of data can be saved and recalled later.
  19. By default, 8 cut buffers are created.
  20. The program is designed primarily for use with textual data.
  21.  
  22. Xcb has two modes of operation.
  23. Normally xcb provides an array of windows on your display,
  24. one per cut buffer, tiled horizontally, vertically, or in some
  25. user specified layout.
  26. Each window displays the contents of its respective cut buffer.
  27. Data can be cut from and pasted to the windows in a similar manner
  28. to xterm.
  29. The buffers can also be rotated.
  30.  
  31. In task mode, xcb lets you access the cut buffers from the command line.
  32. Cut buffers can be loaded from stdin, copied or concatenated
  33. to stdout, or rotated an arbitrary number of positions.
  34. In this mode of operation, xcb performs the requested task
  35. and then exits.
  36. It does not create any windows and
  37. has no interaction with the mouse or keyboard.
  38.  OPTIONS
  39. Xcb supports the full set of X Toolkit Intrinsics options,
  40. as well as those listed below.
  41. Xcb options can appear in any order.
  42. The presence of the
  43. -p,
  44. -r or
  45. -s
  46. options causes xcb to execute in task mode,
  47. described above.
  48.  "-l layout"
  49. This option controls the geometry arrangement of xcb's subwindows.
  50. It is the command line equivalent of the .layout resource,
  51. described below.
  52.  
  53.  "-n count"
  54. Create count cut buffers.
  55. Count can be any integer greater than zero.
  56. This option is the command line equivalent of the .bufferCount
  57. resource, described below.
  58.  
  59.  "-p list"
  60. Print the contents of the listed buffer(s) on stdout.
  61. The buffered data is printed exactly as it is stored in the server.
  62. Selecting two or more buffers has the effect of concatenating
  63. the data on stdout.
  64. The cut buffers are numbered from 0... onwards.
  65. The list can be either a single digit,
  66. a comma separated list of digits,
  67. a range of the form m-n,
  68. or some combination of lists and ranges.
  69. The buffers are printed in listed order,
  70. so repeated numbers in the list can be used to 
  71. duplicate buffer contents.
  72.  
  73.  "-r count"
  74. Rotate the buffers by count positions.
  75. Count can be any integer, positive or negative.
  76. This option may be used in conjunction with the
  77. -n count option to rotate
  78. a specific number of buffers.
  79. If the -n option is not used, xcb will rotate
  80. the number of buffers given by the .bufferCount resource.
  81.  
  82.  "-s list"
  83. Store the data from stdin in the listed buffer(s).
  84. If two or more buffers are selected the input data is duplicated
  85. in each buffer.
  86. Refer to the -p option for the definition of a list.
  87.  WIDGETS and RESOURCES
  88. The xcb widget hierarchy consists of a collection of
  89. custom buffer widgets contained within a single Athena form widget.
  90.  
  91. The name of the form widget is "container",
  92. and its class name is "Form".
  93. The names of the buffer widgets are "buffer0", "buffer1",
  94. "buffer2", .... etc., and their class name is "Buffer".
  95. Each buffer widget supports all the standard core widget
  96. resources, plus the .foreground and .font resources.
  97.  
  98. Application wide resources are as follows:
  99.  
  100.   .bufferCount (default value 8)
  101.  +8
  102. This is the number of buffer widgets to create.
  103. Any number of widgets (greater than zero) can be created.
  104.  -8
  105.  1
  106.   .layout (default value "h")
  107.  +8
  108. Only the first character of the resource value is significant.
  109. This is the geometry arrangement to apply in the form widget.
  110. The layout can be "h" (horizontal), "v" (vertical), or some
  111. other value to disable the geometry code and allow you to build
  112. your own custom layout scheme.  An example is provided in the
  113. application default resources file.
  114.  -8
  115.  
  116.  EVENTS and TRANSLATIONS
  117. Xcb's input semantics are coded into a Toolkit translation table.
  118. The default bindings have been chosen to conform with the default
  119. configuration of other cut and paste clients, such as xterm.
  120. The bindings may be altered or overridden according to your needs.
  121. The actions functions provided by xcb are:-
  122.  
  123. cut()    causes the contents of the chosen cut buffer to become
  124.     the PRIMARY selection.  The window contents, if any,
  125.     are highlighted, and can then be pasted into other
  126.     cut buffers or applications.
  127.  
  128. paste()    causes the value of the PRIMARY selection to be
  129.     converted into text and pasted into the chosen cut
  130.     buffer, overwriting any previous buffer contents.
  131.     If no PRIMARY selection is present, xcb pastes
  132.     the contents of cut buffer zero into the chosen buffer.
  133.  
  134. clear()    clears the chosen cut buffer.
  135.  
  136. rotate(NN)    rotates the cut buffers by NN positions.  NN may
  137.     be any positive or negative number.
  138.  
  139. refresh()    causes the cut buffer window to be cleared and redrawn.
  140.  
  141. selreq()    this action function handles paste requests
  142.     from other clients, or other xcb windows.
  143.     It should always be bound to SelectionRequest events.
  144.  
  145. selclear()    this action function responds to the loss of
  146.     ownership of the PRIMARY selection property.
  147.     It should always be bound to SelectionClear events.
  148.  
  149. quit()    causes xcb to terminate.
  150.  
  151. The default bindings are as follows:-
  152.  
  153. <Btn1Down>:        cut() \n\
  154. Shift <Btn2Down>:    clear() \n\
  155. <Btn2Down>:        paste() \n\
  156. Shift <Btn3Down>:    rotate(-1) \n\
  157. <Btn3Down>:        rotate(1) \n\
  158. <Key>Left:        rotate(-1) \n\
  159. <Key>Right:        rotate(1) \n\
  160. <Key>Up:        rotate(-1) \n\
  161. <Key>Down:        rotate(1) \n\
  162. <Key>q:            quit() \n\
  163. <SelReq>:        selreq() \n\
  164. <SelClr>:        selclear()
  165.  
  166.  EXAMPLES
  167. The following are some examples of xcb task mode usage:-
  168.  
  169. xcb -s 0-7 < /dev/null
  170.  
  171. This clears the first 8 cut buffers in your server.
  172.  
  173. echo "G'day." | xcb -display bigears:0.0 -s 1,3,5,7
  174.  
  175. This loads the string "G'day." into four of the cut buffers
  176. on the display "bigears".
  177.  
  178. ls `xcb -p 2,3`
  179.  
  180. This produces a listing of all the files named in
  181. cut buffers 2 and 3.
  182.  
  183.  
  184. xcb -p 0-7 | xcb -s 0
  185.  
  186. This concatenates the values in the first 8 cut buffers, and places
  187. the result back in cut buffer zero.
  188.  
  189. for i in 0 1 2 3 4 5 6 7
  190. do
  191.     xcb -p $i > $HOME/.xcb/$i
  192. done
  193. for i in 0 1 2 3 4 5 6 7
  194. do
  195.     xcb -s $i < $HOME/.xcb/$i
  196. done
  197.  
  198. This first loop saves the contents of each of the cut buffers
  199. in a separate file under your home directory.  The second loop
  200. restores the cut buffer contents from those files.
  201. When placed in your .logout and .login scripts respectively,
  202. the commands are a simple method of preserving your cut buffers
  203. across login sessions.
  204.  
  205. function g {
  206.     echo "$1\\c" | xcb -s 7
  207.     grep "$@"
  208. }
  209. function vg {
  210.     vi +/`xcb -p 7` "$@"
  211. }
  212.  
  213. These two shell functions exemplify a simple mechanism for saving and
  214. reusing regular expressions.
  215. The first function saves the regex used for grep-ing into
  216. cut buffer 7.  The second function reuses the most recent
  217. grep regex as a search command in vi.
  218. There is considerable scope for expanding and improving these ideas.
  219.  SEE ALSO
  220. xterm(1), xcutsel(1), xclipboard(1), xprop(1)
  221.  
  222. Athena Widget Set - C Language Interface
  223.  AUTHORS
  224. Farrell McKay
  225.  
  226. E-mail: fbm@ptcburp.ptcbu.oz.au
  227.  
  228. XView modifications provided by Danny Vanderryn
  229.  
  230. E-mail: dvanderr@us.oracle.com
  231.  
  232. DESQview/X port done by Kris Williams or Quarterdeck Office Systems
  233.  
  234. E-mail: kris@qdeck.com
  235.  
  236.  COPYRIGHT
  237. Copyright (C) 1992 by Farrell McKay.
  238.  
  239. Permission to use, copy, modify, and distribute this software and its
  240. documentation for any purpose and without fee is hereby granted, provided
  241. that the above copyright notice appears in all copies and that both that
  242. copyright notice and this permission notice appear in supporting
  243. documentation.  This software is provided "as is" without express or
  244. implied warranty.
  245. .SH "BUGS  :-)"
  246. Xlib's underlying protocol for moving selection data
  247. between client and server can sometimes be slow,
  248. depending on the amount of data involved.
  249. Do not expect fast performance if your selections are
  250. big or you want to store big files in your cut buffers!
  251. ("big" means, say, over 10k bytes - but your mileage
  252. may vary).
  253.